package com.ruoyi.project.rm.pojo;

import com.ruoyi.project.system.user.domain.User;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Task {

    private int taskId;
    private String taskName;//任务标题
    private String taskDesc;//任务描述
    private int taskStatus; //任务状态
    private int taskIsUrgent;//紧急程度
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;//开始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;//结束时间
    private int releaseId;//发布人
    private int implementId;//执行人
    private int delay;  //是否延期
    private int transfer;//是否转移

    private User user;

    public Task() {
    }

    public Task(int taskId, String taskName, String taskDesc, int taskStatus, int taskIsUrgent, Date startTime, Date endTime, int releaseId, int implementId, int delay, int transfer, User user) {
        this.taskId = taskId;
        this.taskName = taskName;
        this.taskDesc = taskDesc;
        this.taskStatus = taskStatus;
        this.taskIsUrgent = taskIsUrgent;
        this.startTime = startTime;
        this.endTime = endTime;
        this.releaseId = releaseId;
        this.implementId = implementId;
        this.delay = delay;
        this.transfer = transfer;
        this.user = user;
    }

    @Override
    public String toString() {
        return "Task{" +
                "taskId=" + taskId +
                ", taskName='" + taskName + '\'' +
                ", taskDesc='" + taskDesc + '\'' +
                ", taskStatus=" + taskStatus +
                ", taskIsUrgent=" + taskIsUrgent +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", releaseId=" + releaseId +
                ", implementId=" + implementId +
                ", delay=" + delay +
                ", transfer=" + transfer +
                ", user=" + user +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Task task = (Task) o;

        if (taskId != task.taskId) return false;
        if (taskStatus != task.taskStatus) return false;
        if (taskIsUrgent != task.taskIsUrgent) return false;
        if (releaseId != task.releaseId) return false;
        if (implementId != task.implementId) return false;
        if (delay != task.delay) return false;
        if (transfer != task.transfer) return false;
        if (taskName != null ? !taskName.equals(task.taskName) : task.taskName != null) return false;
        if (taskDesc != null ? !taskDesc.equals(task.taskDesc) : task.taskDesc != null) return false;
        if (startTime != null ? !startTime.equals(task.startTime) : task.startTime != null) return false;
        if (endTime != null ? !endTime.equals(task.endTime) : task.endTime != null) return false;
        return user != null ? user.equals(task.user) : task.user == null;
    }

    @Override
    public int hashCode() {
        int result = taskId;
        result = 31 * result + (taskName != null ? taskName.hashCode() : 0);
        result = 31 * result + (taskDesc != null ? taskDesc.hashCode() : 0);
        result = 31 * result + taskStatus;
        result = 31 * result + taskIsUrgent;
        result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
        result = 31 * result + (endTime != null ? endTime.hashCode() : 0);
        result = 31 * result + releaseId;
        result = 31 * result + implementId;
        result = 31 * result + delay;
        result = 31 * result + transfer;
        result = 31 * result + (user != null ? user.hashCode() : 0);
        return result;
    }

    public int getTaskId() {
        return taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getTaskDesc() {
        return taskDesc;
    }

    public void setTaskDesc(String taskDesc) {
        this.taskDesc = taskDesc;
    }

    public int getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(int taskStatus) {
        this.taskStatus = taskStatus;
    }

    public int getTaskIsUrgent() {
        return taskIsUrgent;
    }

    public void setTaskIsUrgent(int taskIsUrgent) {
        this.taskIsUrgent = taskIsUrgent;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public int getReleaseId() {
        return releaseId;
    }

    public void setReleaseId(int releaseId) {
        this.releaseId = releaseId;
    }

    public int getImplementId() {
        return implementId;
    }

    public void setImplementId(int implementId) {
        this.implementId = implementId;
    }

    public int getDelay() {
        return delay;
    }

    public void setDelay(int delay) {
        this.delay = delay;
    }

    public int getTransfer() {
        return transfer;
    }

    public void setTransfer(int transfer) {
        this.transfer = transfer;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
